<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <button onclick="test()">测试</button>

    <script>

        function test(){
            console.log("当前页面的url路径地址:"+location.href);
            location.reload(); //重新加载当前页面(刷新)
            location.href="http://lagou.com"; //跳转页面
        }
    </script>
</body>
</html>